import './index.css'
// import './theme.css'
import './theme.scss'

const toggle = document.querySelector('.toggle-btn')
document.documentElement.classList.add('light')

toggle!.addEventListener('click', function (e) {
  const event = e as MouseEvent
  document.documentElement.style.setProperty('--x', event.clientX + 'px')
  document.documentElement.style.setProperty('--y', event.clientY + 'px')
  if (document.startViewTransition) {
    document.startViewTransition(function () {
      document.documentElement.classList.toggle('dark')
      document.documentElement.classList.toggle('light')
    })
  } else {
    document.documentElement.classList.toggle('dark')
    document.documentElement.classList.toggle('light')
  }
})
